<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1. 数组
let names = ['小红', '小明', '小强']

for (let i = 0; i < names.length; i++) {
  console.log(names[i])
}

// 2. 对象
let person1 = {name: '小红', age: 18, gender: 'woman'}

for (let key in person1) {
  // key 为属性值
  // console.log(key)
  console.log(person1[key])
}

// 3. 对象数组
let students = [
  {name: '小红', age: 18, gender: 'woman'},
  {name: '小明', age: 19, gender: 'man'},
  {name: '小强', age: 18, gender: 'woman'}
]

for (let i = 0; i < students.length; i++) {
  console.log(students[i].name)
}
    </script>
</body>
</html>